import request from '../utils/request'

const fetchCate = (params = {}) => request.get('/shop/goods/category/all', { params })
// 获取首页banners数据
const fetchBanner = (params = {}) => request.get('/banner/list', { params })
// 获取商品列表数据
const fetchItems = (params = {}) => request.post('/shop/goods/list/v2', params)
// 获取商品详情
const fetchDetail = (id) => request.get('/shop/goods/detail', {
  params: { id }
})
// 注册用户
const userRegister = (params = {}) => request.post('/user/username/register', params)
const userLogin = (params = {}) => request.post('/user/username/login', params)
export {
  fetchCate,
  fetchBanner,
  fetchItems,
  fetchDetail,
  userRegister,
  userLogin
}
